﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


   public class Student: ICloneable
{
    private string name;
    public string Name
    {
        get { return name; }
        set { name = value; }
    }

    private string ssn;
    public string SSN
    {
        get { return ssn; }
        set { ssn = value; }
    }

    private string address;
    public string Address
    {
        get { return address; }
        set { address = value; }
    }

    private string email;
    public string Email
    {
        get { return email; }
        set { email = value; }
    }

    private int course;
    public int Course
    {
        get { return course; }
        set { course = value; }
    }

    private Specialties specialty;
    public Specialties Specialty
    {
        get { return specialty; }
        set { specialty = value; }
    }

    private Universities university;
    public Universities University
    {
        get { return university; }
        set { university = value; }
    }

    private Faculties faculty;
    public Faculties Faculty
    {
        get { return faculty; }
        set { faculty = value; }
    }

    public enum Specialties { KN, I, IS, SI };

    public enum Universities { SU, TU, UNSS, NBU, AUBg };

    public enum Faculties { FMI, StopFak, HF, FzF, Automatics, Law, Economics };
	
	public override bool Equals(object other)
	{
		Student oth = other as Student;
        if(oth == null)
        {
			return false;
		}
		return this.SSN == oth.SSN && this.University == oth.University && this.Specialty == oth.Specialty;
	}
	
	public override int GetHashCode()
	{
		return SSN.GetHashCode();
	}
	
	public static bool operator ==(Student first, Student other)
	{
        if (ReferenceEquals(other, null))
        {
            return false;
        }
		return first.Equals(other);
	}
	
	public static bool operator !=(Student first, Student other)
	{
		return !first.Equals(other);
	}
	
	public override string ToString()
	{
		string s = "";
		s += this.Name + " ";
        s += this.University+" ";
        s += this.Faculty + " ";
        s += this.Specialty;
        return s;
	}

    object ICloneable.Clone()
    {
        Student cloning = new Student();
        cloning.Name = this.Name;
        cloning.Specialty = this.Specialty;
        cloning.SSN = this.SSN;
        cloning.University = this.University;
        cloning.Course = this.Course;
        cloning.Address = this.Address;
        cloning.Email = this.Email;
        return cloning;
    }
}
